<html>
<head><meta charset="utf-8"><title>parking_lot::Mutex in std · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html">parking_lot::Mutex in std</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="190330533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190330533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190330533">(Mar 11 2020 at 20:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/219381-t-libs/topic/Replacing.20mpsc/near/190330406" title="#narrow/stream/219381-t-libs/topic/Replacing.20mpsc/near/190330406">said</a>:</p>
<blockquote>
<p>This feels similar to the move to replace std's Mutex with parking_lot::Mutex. Basically std::sync::Mutex will end up as a wrapper around parking_lot::Mutex, but with a "worse" API since it is already stable. ("worse" in this case refers to poisoning, which nobody cares about, but that's off-topic)</p>
</blockquote>
<p>Has this happened?</p>



<a name="190330781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190330781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190330781">(Mar 11 2020 at 20:59)</a>:</h4>
<p>It's being worked on... slowly</p>



<a name="190330886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190330886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190330886">(Mar 11 2020 at 21:00)</a>:</h4>
<p>iirc, this stalled out with some parking_lot changes in upstream requested by Alex, but I forget the details. There was also some problem with Instant::now coupling</p>



<a name="190330887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190330887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190330887">(Mar 11 2020 at 21:00)</a>:</h4>
<p>Not yet.</p>



<a name="190330933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190330933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190330933">(Mar 11 2020 at 21:00)</a>:</h4>
<p>Basically it's stalled since nobody is actively working on it.</p>



<a name="190330956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190330956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190330956">(Mar 11 2020 at 21:00)</a>:</h4>
<p>faern isn't?</p>



<a name="190331006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190331006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190331006">(Mar 11 2020 at 21:01)</a>:</h4>
<p>I'll ask him about it at the next meetup then :D</p>



<a name="190331009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190331009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190331009">(Mar 11 2020 at 21:01)</a>:</h4>
<blockquote>
<p>It's being worked on... slowly</p>
</blockquote>
<p>Yeah, I remember people talking about it at RustFest Rome <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span></p>



<a name="190331031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190331031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190331031">(Mar 11 2020 at 21:01)</a>:</h4>
<p>for reference: <a href="https://github.com/rust-lang/rust/pull/56410" target="_blank" title="https://github.com/rust-lang/rust/pull/56410">https://github.com/rust-lang/rust/pull/56410</a></p>



<a name="190331048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190331048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190331048">(Mar 11 2020 at 21:01)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="117909">@faern</span></p>



<a name="190331199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190331199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190331199">(Mar 11 2020 at 21:03)</a>:</h4>
<p>Alex and I talked a while ago about reforming std::sync more broadly - moving things out to more "normal" places like std::mutex::Mutex and removing poisoning in those versions</p>



<a name="190592860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190592860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> faern <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190592860">(Mar 14 2020 at 11:25)</a>:</h4>
<p>I have not worked on the parking_lot integration for many months. When I started, the intention was to just integrate an already well functioning parking_lot into std. It then exploded in many directions. Alex was unhappy with quite a few things in parking_lot itself. And there are issues with how well it can work on some platforms (for example SGX and wasm last time I checked?).<br>
I contributed quite a few improvements to parking_lot, but nowhere near everything needed to cover Alex's review.<br>
With those things in mind it felt like the project outgrew the energy and time I had.</p>



<a name="190593169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190593169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> faern <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190593169">(Mar 14 2020 at 11:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="243558">Steven Fackler</span> <a href="#narrow/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std/near/190331199" title="#narrow/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std/near/190331199">said</a>:</p>
<blockquote>
<p>Alex and I talked a while ago about reforming std::sync more broadly - moving things out to more "normal" places like std::mutex::Mutex and removing poisoning in those versions</p>
</blockquote>
<p>My two cents is that <code>std::mutex</code> is less discoverable and pollutes the namespace more. Is there a general move in <code>std</code> to have shallower modules in general? It makes it harder to discover and compare synchronization primitives if <code>RwLock</code> and <code>Mutex</code> are not in the same module.</p>



<a name="190595051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190595051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> faern <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190595051">(Mar 14 2020 at 12:15)</a>:</h4>
<p>Correction: <code>std::mutex</code> is in itself not hard to discover. But it moves different related primitives further from each other was my point :)</p>



<a name="190602111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190602111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190602111">(Mar 14 2020 at 15:48)</a>:</h4>
<p><span class="user-mention" data-user-id="117909">@faern</span> There's not a move for shallower modules. I think the reasoning for having it as a separate module is that it allows breaking changes.</p>



<a name="190610035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190610035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> faern <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190610035">(Mar 14 2020 at 19:22)</a>:</h4>
<p>It can have breaking changes in the same module if the name is different. Or put under a submodule. <code>std::sync::v2</code>? :)</p>



<a name="190610947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/parking_lot%3A%3AMutex%20in%20std/near/190610947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/parking_lot.3A.3AMutex.20in.20std.html#190610947">(Mar 14 2020 at 19:39)</a>:</h4>
<p><span class="user-mention" data-user-id="117909">@faern</span> Right, but neither of those solutions are strictly better, they are what you prefer. There will always be different tradeoffs.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>